﻿@inherits BaseComponent

<div style="text-align:right">
    <Button IsAsync=true Text="保存" Color="Color.Info" OnClickWithoutRender=Save></Button>
</div>
<Card>
    <CardHeader>
        @this.SettingType?.TypeTitle
    </CardHeader>
    <CardBody>
                <Loading IsHideLoading=IsLoadComplete></Loading>

        <div class="row g-3 form-inline" style="min-height:300px;">
            @foreach (var model in Models)
            {
                if (model.PropertyName == nameof(BaseSettingModel.TypeTitle))
                {
                    model.PropertySeq = 3;
                }
                if (model.PropertyName == nameof(BaseSettingModel.TypeDetails))
                {
                    model.PropertySeq = 2;
                }
            }

            @foreach (var model in Models.OrderByDescending(x => x.PropertySeq))
            {
                <div class="col-12 col-sm-12">
                    @if (model.PropertyType == typeof(int).Name)
                    {
                        <BootstrapInputNumberString @bind-Value=model.PropertyValue DisplayText=@model.PropertyTitle ShowLabel=true></BootstrapInputNumberString>
                    }
                    @if (model.PropertyType == typeof(DateTime).Name)
                    {
                        <DatetimeString @bind-Value=model.PropertyValue DisplayText=@model.PropertyTitle ShowLabel=true></DatetimeString>
                    }
                    @if (model.PropertyType == typeof(string).Name)
                    {
                        <BootstrapInput @bind-Value=model.PropertyValue DisplayText=@model.PropertyTitle ShowLabel=true></BootstrapInput>
                    }
                </div>
            }
        </div>
    </CardBody>
</Card>
